package com.project.bean;


/**
 * 购物车实体类
 */
public class ShopCarBean {
    /**购物车id*/
    private int id;
    /**购物车中商品对象*/
    private ProductBean product;
    /**所属用户*/
    private UserBean user;
    /**购物车购买数量*/
    private int num;

    public ShopCarBean() {
    }

    public ShopCarBean(int productId, int userId, int totalNum) {
        this.product = new ProductBean();
        this.product.setId(productId);
        this.user = new UserBean();
        this.user.setId(userId);
        this.num = totalNum;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "ShopCarBean{" +
                "id=" + id +
                ", product=" + product +
                ", user=" + user +
                ", num=" + num +
                "}\n";
    }
}
